<?php 
	// no direct access
	//defined('_JEXEC') or die('Restricted access'); 
?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
	<table class="adminlist">
	<thead>
		<tr>
			<th width="5">
				<?php echo JText::_( 'ID' ); ?>
			</th>
			<th width="20">
				<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
			</th>			
			<th>
				<?php echo JText::_( 'SENDER ADDRESS' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'WEEK START ON' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'DEFAULT CALENDAR PAGE' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'THEME' ); ?>
			</th>
		</tr>
	</thead>
	<?php
	$k = 0;
	for ($i=0, $n=count( $this->items ); $i < $n; $i++)
	{
		$row = &$this->items[$i];
		$checked 	= JHTML::_('grid.id',   $i, $row->id );
		$link 		= JRoute::_( 'index.php?option=com_jbschedule&controller=settings&task=edit&cid[]='. $row->id );

		?>
		<tr class="<?php echo "row$k"; ?>">
			<td>
				<?php echo $row->id; ?>
			</td>
			<td>
				<?php echo $checked; ?>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->sender_address; ?></a>
			</td>
			<td>
				<?php
					switch ($row->week_start_on){
						case 0 :
							echo JText::_("MONDAY");
							break;
						case 1 :
							echo JText::_("TUESDAY");
							break;
						case 2 :
							echo JText::_("WEDNESDAY");
							break;
						case 3 :
							echo JText::_("THURSDAY");
							break;
						case 4 :
							echo JText::_("FRIDAY");
							break;
						case 5 :
							echo JText::_("SATURDAY");
							break;
						case 6 :
							echo JText::_("SUNDAY");
							break;						
					}
				?>
			</td>
			<td>
				<?php
					switch ($row->default_calendar_page){
						case 0 :
							echo JText::_("WEEK");
							break;
						case 1 :
							echo JText::_("MONTH");
							break;
						case 2 :
							echo JText::_("YEAR");
							break;
					}
				?>
			</td>
			<td><?php echo $row->theme;?></td>			
		</tr>
		<?php
		$k = 1 - $k;
	}
	?>
	</table>
</div>

<input type="hidden" name="option" value="com_jbschedule" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="view" value="settings" />
<input type="hidden" name="controller" value="settings" />
</form>
